//'2017-08-12 23:00:00' 转化为 2017年08月12日
export const hyearMouthDay = (date)=>{
  let _dateNum = new Date(date.replace(/-/g, '/')).getTime();
  let _vurDate = new Date(_dateNum)
  let _curDay = `${_vurDate.getFullYear()}年${_vurDate.getMonth()+1}月${_vurDate.getDate()}日`;
  return _curDay
}
//处理填报时间 2020-07-18 转为*月*日 (7月18日)
export const hMouthDay = (date) => {
  let _dateNum = new Date(date).getTime();
  let _vurDate = new Date(_dateNum)
  let _curDay = `${_vurDate.getMonth()+1}月${_vurDate.getDate()}日`;
  return _curDay
}
//传入时间秒数 转化为 时 分 秒
export const hHMS = (value) => {
  let theTime = parseInt(value); // 秒
  let middle = 0; // 分
  let hour = 0; // 小时
  if (theTime > 60) {
    middle = parseInt(theTime / 60);
    theTime = parseInt(theTime % 60);
    if (middle > 60) {
      hour = parseInt(middle / 60);
      middle = parseInt(middle % 60);
    }
  }
  let result = "" + parseInt(theTime) + "";
  if (middle > 0) {
    result = "" + parseInt(middle) + ":" + result;
  }
  if (hour > 0) {
    result = "" + parseInt(hour) + ":" + result;
  }
  return result;
}
// 传入2020-07 返回 2020年6月
export const hyearMouth = (value) => {
  let _year = value.substr(0, 4) * 1
  let _mouth = value.substr(value.length - 2) * 1 - 1
  let _ruslut = `${_year}年${_mouth}月`
  return _ruslut;
}
// 传入2020-07 返回 7
export const hmouth = (value) => {
  let _mouth = value.substr(value.length - 2) * 1
  return _mouth;
}